package com.mjk.common.web.getway.restful.interceptor.annotation;

import com.mjk.common.web.getway.conf.GetWayConf;
import com.mjk.common.web.getway.restful.interceptor.type.GetWayInterceptorType;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.core.annotation.AliasFor;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

/**
 * 协议拦截器
 * @author mjk
 *
 */
@Target(value={ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
@Order
@ConditionalOnBean(value={GetWayConf.class})
public @interface BeeGetWayInterceptor {
	/**
	 * 拦截器执行顺序
	 */
	@AliasFor(annotation=Order.class,attribute="value")
	int value() ;
	/**
	 * 是否打开该拦截器
	 */
	boolean flag() default true;
	/**
	 * 拦截器类型
	 */
	GetWayInterceptorType[] interceptorType() default GetWayInterceptorType.COMMON;
}
